package sg.edu.nus.iss.vmcs.maintenance;

public class AccessManager {
	private MaintenanceController mctrl;
	private Password pswd;
	private boolean loginState = false;

	public AccessManager(MaintenanceController mc) {
		mctrl = mc;
		pswd = new Password();
	}

	public void closeDown() {
	}

	public void processPassword(String ps) {
		boolean psr;

		psr = pswd.validatePassword(ps);
		loginState = psr;
		mctrl.loginMaintainer(psr);
	}

	public boolean getLoginState() {
		return loginState;
	}

	public void logout() {
		loginState = false;
	}
}